package com.example.ujsfish.model.boundary;

import com.example.ujsfish.model.MyPoint;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ObstaclesBody {

        private int status;
        private String msg;
        private List<String> data;
        private String ok;
        public void setStatus(int status) {
            this.status = status;
        }
        public int getStatus() {
            return status;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }
        public String getMsg() {
            return msg;
        }

        public void setData(List<String> data) {
            this.data = data;
        }
        public List<String> getData() {
            return data;
        }

        public void setOk(String ok) {
            this.ok = ok;
        }
        public String getOk() {
            return ok;
        }

    
        public List getObs(){
            List obsList = new ArrayList();
            for (String str :
                    this.data) {
                String[] split = str.split(",", 3);
                String[] split1 = split[2].split(";");
                List<MyPoint> myPointList = new ArrayList<>();
                for (int i = 0; i < split1.length; i++) {
                    String[] split2 = split1[i].split(",");
                    myPointList.add(new MyPoint(split2[0],split2[1]));
                }
                obsList.add(myPointList);
            }

            return obsList;
        }
        
}
